<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格的样式</title>
    <style>
        table{
            width: 50%;
            border: 1px solid black;
            /* border-spacing:0px; */
            border-collapse: collapse;
            margin: 0 auto;
        }
        td{
            border: 1px solid black;
            height: 50px;
        }
        th{
            border: 1px solid black;
        }
        table tr:nth-child(odd){
            background-color: #bfa;
        }
        .box1{
            display: table-cell;
            width: 300px;
            height: 300px;
            background-color: orange;
            vertical-align:middle;
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: #bfa;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">

        </div>
    </div>
    <table>
        <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>地址</th>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>19</td>
            <td>花果山</td>
        </tr>
   
        <tr>
            <td>2</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>28</td>
            <td>高老庄</td>
        </tr>
   
        <tr>
            <td>3</td>
            <td>沙和尚</td>
            <td>男</td>
            <td>19</td>
            <td>流沙河</td>
        </tr>
   
        <tr>
            <td>4</td>
            <td>唐僧</td>
            <td>男</td>
            <td>19</td>
            <td>女儿国</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>19</td>
            <td>花果山</td>
        </tr>
   
        <tr>
            <td>2</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>28</td>
            <td>高老庄</td>
        </tr>
   
        <tr>
            <td>3</td>
            <td>沙和尚</td>
            <td>男</td>
            <td>19</td>
            <td>流沙河</td>
        </tr>
   
        <tr>
            <td>4</td>
            <td>唐僧</td>
            <td>男</td>
            <td>19</td>
            <td>女儿国</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>19</td>
            <td>花果山</td>
        </tr>
   
        <tr>
            <td>2</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>28</td>
            <td>高老庄</td>
        </tr>
   
        <tr>
            <td>3</td>
            <td>沙和尚</td>
            <td>男</td>
            <td>19</td>
            <td>流沙河</td>
        </tr>
   
        <tr>
            <td>4</td>
            <td>唐僧</td>
            <td>男</td>
            <td>19</td>
            <td>女儿国</td>
        </tr>
   
    </table>
</body>
</html>